<template>
  <transition name="slide-down">
    <div class="title-wrapper" v-show="ifMenuShow">
      <div class="title-left" @click="handleClickGo">
        <span class="iconfont">&#xe6a4;</span>
      </div>
    </div>
  </transition>
</template>

<script>
  export default {
    name: "EbooksTitle",
    props: {
      ifMenuShow: {
        type: Boolean,
        default: false
      },
    },
    data() {
      return {
      }
    },
    methods: {
      handleClickGo() {
        this.$router.go(-1);//返回上一层
      },
    },
  }
</script>

<style lang="less" scoped>
.title-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 50%;
  max-width: 16rem;
  width: 100%;
  height: 1.875rem;
  margin-left: -8rem;
  background-color: #fff;
  z-index: 102;
  .title-left {
    width: 15%;
    text-align: center;
    color: #666666;
    font-size: 0.5rem;
  }
}
.slide-down-enter,
.slide-down-leave-to {
  transform: translate3d(0, -100%, 0);
}
.slide-down-enter-to,
.slide-down-leave,
.slide-up-enter-to,
.slide-up-leave {
  transform: translate3d(0, 0, 0);
}
.slide-down-enter-active,
.slide-down-leave-active,
.slide-up-enter-active,
.slide-up-leave-active {
  transition: all 0.3s linear;
}
.slide-up-enter,
.slide-up-leave-to {
  transform: translate3d(0, 1.875rem, 0);
}
</style>